package com.unism.common.schedulerTask;

import java.util.HashMap;

import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Test extends TaskJob{

	private static Logger log = LoggerFactory.getLogger(Test.class.getName()) ;
	
	public static void main(String[] args) throws Exception{
//		SchedulerTaskSupport.addSecondlyJob("test", "testGroup", Test.class, null, 10, 1, 2) ;
//		SchedulerTaskSupport.addMinutelyJob("test", "testGroup", Test.class, null, 1, 1, -1) ;
//		SchedulerTaskSupport.addDailyJob("test", "testGroup", Test.class, null, 11, 16) ;
//		SchedulerTaskSupport.addWeeklyJob("test", "testGroup", Test.class, null, 6, 11, 34) ;
//		SchedulerTaskSupport.addWorkingDayInWeekJob("test", "testGroup", Test.class, null, 11, 41) ;
//		SchedulerTaskSupport.addMonthlyJob("test", "testGroup", Test.class, null, 25, 11, 44) ;
		
		HashMap<String , Object> jobDataMap	= new HashMap<String , Object>() ;
		jobDataMap.put("123", "test123") ;
		
		SchedulerTaskSupport.addSecondlyJob("test", "testGroup", Test.class, jobDataMap, 10, 1, 2) ;
	}

	@Override
	public void execute(JobExecutionContext ctx) throws JobExecutionException {
		log.info("1_" + System.currentTimeMillis() ) ;
		JobDataMap jobDataMap = ctx.getJobDetail().getJobDataMap() ;
		if(jobDataMap != null){
			Object o = jobDataMap.get("123") ;
			log.info("1_" + o ) ;
		}
	}

}
